load("//tools:defaults.bzl", "ng_module", "ts_devserver")

package(default_visibility = ["//modules/playground:__subpackages__"])

ng_module(
    name = "routing",
    srcs = glob(["**/*.ts"]),
    assets = glob(["**/*.html"]),
    tsconfig = "//modules/playground:tsconfig-build.json",
    deps = [
        "//packages/core",
        "//packages/platform-browser",
        "//packages/platform-browser-dynamic",
        "//packages/router",
        "@npm//rxjs",
    ],
)

ts_devserver(
    name = "devserver",
    port = 4200,
    static_files = [
        # This is temporarily needed because Angular imports from "rxjs/operators/index", while
        # there is only one RxJS UMD bundle that re-exports everything at the root.
        "//modules/playground:systemjs-rxjs-operators.js",
        "//third_party/fonts.google.com/open-sans",
        "@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
        "@npm//:node_modules/tslib/tslib.js",
        "//packages/zone.js/bundles:zone.umd.js",
        "index.html",
        "@npm//:node_modules/reflect-metadata/Reflect.js",
        "@npm//:node_modules/systemjs/dist/system.js",
        "//modules/playground:systemjs-config.js",
        "load-app.js",
    ] + glob(["**/*.css"]),
    deps = [
        ":routing",
        "//packages/zone.js/lib",
    ],
)
